<h1>Listing Bills</h1>
<table id="item_list"  border="1">
  <tr>
    <% for column in Item.content_columns %>
      <th><%= column.human_name %></th>
    <% end %>
  </tr>
  <% @items.each do |item| %>
    <tr>
      <% Item.content_columns.each do |column| %>
          <td>
            <%= item.send(column.name) %>
          </td>
      <%  end %>
    </tr>
  <%end%>
</table>





<p id="add_link">
  <%=button_to_function "Add new bill", visual_effect(:toggle_slide, "add_bill",:duration => 1)%>
</p>
<div id="add_bill" style="display:none;">
  <% form_remote_tag(:url => {:action => 'create'},
    :update => "bill_list", :position => :bottom,
    :html => {:id => 'bill_form'}) do %>
    <br/>
    Description: <%= text_field "bill", "description" %>
    <br/>
    Item Code:<%= collection_select(:bill, :item_code, @items, :item_code, :item_code, :class =>"Item") %>
    <br/>
    Currency: <%= text_field "bill", "curr" %>
    <br/>
    Amount: <%= text_field "bill", "amount" %>
    <br/>
    Rate: <%= text_field "bill", "rate" %>
    <br/>
    Amount Inr: <%= text_field "bill", "amount_inr" %>
    <br/>
    <%= submit_tag 'Add' %>
  <% end %>
</div>

</body>
